package com.donger.business.modules.trace.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.donger.business.modules.trace.mapper.TraceMapper;
import com.donger.business.modules.trace.entity.Trace;
import com.donger.business.modules.trace.service.TraceService;
import org.springframework.stereotype.Service;

/**
 * (Trace)表服务实现类
 *
 * @author makejava
 * @since 2020-04-15 15:40:20
 */
@Service("traceService")
public class TraceServiceImpl extends ServiceImpl<TraceMapper, Trace> implements TraceService {

    @Override
    public Trace getTable() {

        Trace table = this.baseMapper.getTable();
        if (table.getProcessError() != null) {
            if (table.getProcessError().equals("0")) {
                table.setProcessError("无异常");
            } else if (table.getProcessError().equals("1")) {
                table.setProcessError("异常");
            }
        }
        if (table.getStorageError() != null){
        if (table.getStorageError().equals("0")){
            table.setStorageError("无异常");
        }else if (table.getStorageError().equals("1")){
            table.setStorageError("异常");
        }
        }
        return table;
    }
}